package DataBase;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import DataObjects.Item;

public class CheckExistPresentCard {
	
	private int numCard;
	private int flagExists=0;
	public CheckExistPresentCard(int numCard){
		this.numCard = numCard;
	}
	
	public int checkExistPresentCard()
	{
		SQLConnection sc=new SQLConnection();
		try {
			PreparedStatement ps = sc.getConnection().prepareStatement("Select balance from client_club where numCard=?;");
			ps.setInt(1,numCard);
			ResultSet rs=ps.executeQuery();	
			 while(rs.next())
		        {   
				 flagExists=1;
		        }
			
		}
		catch(SQLException e){
			e.printStackTrace();
			flagExists=1;
			
		}
		return flagExists;
	}

}
